/* ************************************************************************

   Copyright:

   License:

   Authors: SALMON Charles

************************************************************************ */

/**
 * Use this class to create a new service
 */
qx.Class.define("bip.services.AbstractService",
{
  extend : qx.core.Object,
  
  events :
  {
    "loaded" : "qx.event.type.Data",
    "error" : "qx.event.type.Data",
    "loading": "qx.event.type.Data"
  },
  
  construct : function()
  {
    this.base(arguments);
    this._store = new bip.rpc.Json(null, null);
    this._store.addListener("error",function(evt) {
    	this.fireDataEvent("error",evt.getData());
    },this);
    this._store.addListener("loaded",function(evt) {
    	this.fireDataEvent("loaded",evt.getData());
    },this);
    this._store.addListener("loading",function(evt) {
    	this.fireDataEvent("loading",evt.getData());
    },this);
    
  },
  
  members :
  {
    _store : null
  }
  
});